<template>
  <div class="banner">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(banner) in bannerList" :key="banner.id">
        <img :src="banner.image_url" alt="" style="width:100%">
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { mapState, mapGetters } from 'vuex'
import Vue from "vue";
import { Swipe, SwipeItem } from "vant";
Vue.use(Swipe);
Vue.use(SwipeItem);
export default {
  name: "BannerList",
  computed:{
    ...mapGetters('home',['bannerList'])
  },
  mounted() {
    this.$store.dispatch('home/getBannerList')
  },
};
</script>

<style lang='less' scoped>
</style>
